package cn.bone.alibabacloud.controller;

import cn.bone.alibabacloud.service.IAccountService;
import cn.bone.springcloud.base.bean.CommonResult;
import cn.bone.springcloud.base.bean.Ref;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class AccountController {

    @Resource
    private IAccountService accountService;

    @PostMapping(value = "/account/decrease")
    public CommonResult decrease(@RequestParam("userId")Integer userId,
                          @RequestParam("money")Integer money){

        accountService.decrease(userId,money);

        return Ref.ok();
    }
}
